use actix_web::{HttpResponse, get};
use common::ctx::get_system_conf;
use common::error::MyError;

#[get("/un-auth-api/sys/version")]
async fn sys_version() -> Result<HttpResponse, MyError> {
    Ok(HttpResponse::Ok().json(&*get_system_conf()?.version))
}
#[get("un-auth-api/sys/mode")]
async fn mode() -> Result<HttpResponse, MyError> {
    Ok(HttpResponse::Ok().json(&*get_system_conf()?.mode))
}